Skip to main content

Managing data with Toolbox

5 Tasks

30 mins

Visible to: All users
Beginner Pega Robotic Automation 22.1 Robotic Process Automation English

Scenario

The Robotic Banking company acquires the Pega Finance webpage that offers the Online Bill Pay system. All customer transactions in the Pega Finance system move to the Robot Banking company BankerInsight application for record consolidation. 

The Robotic Banking company offers a discount to Pega Finance customers who have already signed up and created an account in BankerInsight before the system update. The automation adds a 20% discount to all Pega Finance invoices from the acquisition period and assigns the deal to the BankerInsight account.  

Complete the following tasks:

  • Create an automation that finds Pega Finance customers with the account number corresponding to the BankerInsight account.
  • Create an automation that retrieves the invoice data.
  • Compare the invoice data with the discount period.
  • Concatenate bonus memo and invoice ID to use as a transaction description.
  • Create an automation that applies a 20% discount with proper description to the BankerInsight application. 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Create the Finance_CustomerSearch automation.

Create an automation that loops through the Pega Finance customer list and selects the customer of the given account number. The account number is an input parameter of the automation.

  1. Download the Robotic Banking project:
  2. Save the file to your desktop and unzip the file to extract the project folder to your C:\Users\<username>\Documents\Pega Robot Studio\Projects\.
  3. On the Home screen in Pega Robot Studio, click Open Project, and then navigate to the projects folder and open Robotic Banking.pegaproject
    Note: The starter project includes a configured BankerInsight application. The value of the Path field must match the location of BankerInsight on your local computer for the project to function properly. In the BankerInsight application, change the value of the Path to the location of your BankerInsight application.
  4. In the Project Explorer, click to open the Finance_CustomerSearch automation.
  5. Add the following design blocks to the automation surface: 
    Design block name Actions Connections
    PerformClick method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining, and then drag the lnkCustomers control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the PerformClick (no parameters) method and then click Add.
    1. Automation link: Entry Point - PerformClick.
    WaitForCreate method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining, and then drag the tblAccounts control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter WaitForCreate.
    4. On the Method tab, select the WaitForCreate (no parameters) method and then click Add.
    1. Automation link: PerformClick - WaitForCreate.
    2. Automation link: WaitForCreate > Result > False - Jump To Error (Customer table unavailable).
    GetClones method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts, and then drag the trAccounts control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter GetClones.
    4. On the Method tab, select the method and then click Add.
    1. Automation link: WaitForCreate > Result > False - GetClones.
    ListLoop
    1. On the Toolbox tab, in the search field, enter ListLoop.
    2. Drag the ListLoop component to the automation surface.
    1. Automation link: GetClones - ListLoop.
    2. Data link: GetClones > Result - ListLoop - List.
    3. Automation link: ListLoop > Completed - Jump To Error (Customer not found).
    Text property
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts > trAccounts, and then drag the tdAccountNum control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the checkbox for the Text property and then click Add(1).
    1. Automation link: ListLoop > ItemYielded - tdAccountNum.
    Equals method
    1. In the Toolbox, expand the Data handling > Strings > Compare folder.
    2. Drag the Equals method to the automation surface. 
    1. Automation link: tdAccountNum - Equals.
    2. Data link: tdAccountNum > Text - Equals > string1.
    accountNumber local variable
    1. On the Palette, expand Locals > Run.
    2. Drag the accountNumber variable to the automation surface.
    1. Data link: accountNumber - Equals > string2.
    ListLoop Break method
    1. On the Palette, expand the Locals section, and drag the ListLoop to the automation surface.
    2. In the Select action dialog box, click More and in the search field enter Break.
    3. On the Method tab, select Break and then click Add.
    1. Automation link: Equals > Result > True - Break.
    PerformClick method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts > trAccounts, and then drag the lnkAccountName control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the method PerformClick (no parameters) and then click Add.
    1. Automation link: Break - lnkAccountName.
    2. Automation link: lnkAccountName - Jump To Exit.
  6. Connect the design blocks as shown in the following figure:
    The Finance_CustomerSearch automation with automation and data links connected.
  7. On the toolbar, click Save to save the automation.

Verify the step

  1. In the Project Explorer, click and open BillPaySystemDiscount automation.
  2. In the upper-right corner, click the Test button to run the automation.
  3. On the Testing automation dialog box, in the accountNumber input field, enter 4, and then click Test
    The testing autmation dialog box with the accountNumber parameter field.
  4. Verify that Test complete window is displayed with the errMessage parameter set to Customer not found.
    The Test complete window with output parameter set to Cusomer not found.

2 Create the Finance_GetInvoiceData automation.

Create an automation that selects the customer's invoice, retrieves invoice data (invoice number, date, amount, and memo), and adds it as a Lookup Table record.

  1. In the Project Explorer, click and open Finance_GetInvoiceData automation.
  2. On the Palette, click Applications, and then select Show hidden items
  3. Add the following design blocks to the automation surface: 
    Design block name Action Connections
    GetClones method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices> tblInvoices, and then drag the trInvoices control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter GetClones.
    4. On the Method tab, select the method and then click Add.
    1. Automation link: WaitForCreate > Result > True - trInvoices.
    ListLoop component
    1. In the Toolbox search field, enter ListLoop.
    2. Drag the ListLoop component to the automation surface.
    1. Automation link: GetClones - ListLoop.
    2. Data link: GetClones > Result - ListLoop > List.
    3. Automation link: ListLoop > Completed - Jump To Exit.
    PerformClick method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices> tblInvoices > trInvoices and then drag the lnkInvoice control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the PerformClick (no parameters) method and then click Add.
    1. Automation link: ListLoop > ItemYielded - PerfomrClick.
    2. Automation link: PerformClick - WaitForCreate.
    AddRecord method
    1. On the Palette tab, expand the Globals section and then drag the Invoice Lookup Table to the automation surface.
    2. In the Select action dialog box, click More.
    3. In the search field, enter AddRecord.
    4. On the Method tab, select the method and then click Add.
    1. Automation link: WaitForCreate > Result > True - AddRecord.
    2. Automation link: AddRecord - WaitForEvent.
    Text properties
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > frmInvoices, and then drag the txtInvoiceNumber control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the checkbox for Text property and then click Add.
    5. Repeat steps a-d to add text property for the following controls: txtInvoiceDatetxtInvoiceAmounttxtInvoiceMemo
    1. Data Link: txtInvoiceNumber - AddRecord > key_invoiceNumber.
    2. Data link: txtInvoiceDate - AddRecord > transactionDate.
    3. Data link: txtInvoiceAmount - AddRecord > transactionAmount.
    4. Data link: txtInvoiceMemo - AddRecord > invoiceMemo.
  4. Connect the design blocks as shown in the following figure:
    The GetInvoiceData automation that collects information about invoice to the lookup table.
  5. On the toolbar, click Save to save the automation.

Verify the step

  1. In the Project Explorer, click and open BillPaySystemDiscount automation.
  2. In the upper-right corner, click the Test button to run the automation.
  3. On the Testing automation dialog box, in the accountNumber input field, enter 73001, and then click Test
    The Testing automation dialog box with customer number set to 73001 value for testing.
  4. Verify that Test complete window is displayed with the errMessage parameter set to Selected customer has no invoices.
    The test complete dialog box with the error message: Selected customer has no invoices.

3 Verify the system move date

Create an automation that retrieves the invoice date and compares it with the discount deadline date. The discount deadline is a global variable that determines the invoices that are needed to proceed.

  1. In the Project Explorer, select and open the CompareDate automation
  2. Add the following design blocks to the automation surface: 
    Design block name Action Connections
    GetRecord method
    1. On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
    2. In the Select action dialog box, select the GetRecord method, and then click Add.
    1. Automation link: Entry point - GetRecord.
    2. Automation link: GetRecord > Result > False - Jump To Error (Failed to get record from the lookup table).
    Value property
    1. In the Palette, expand Globals and drag the invoiceNumber variable to the automation surface.
    2. In the Select action window, select Value property and then click Add.
    1. Data link: invoiceNumber > Value - GetRecord.
    TryParse method
    1. In the Toolbox, navigate to the Data Handling > Dates Convert folder.
    2. In the Convert folder, drag the TryParse method onto the automation surface. 
      Data handling Date TryParse method in the toolbox
    1. Automation link: GetRecord > Result > True - TryParse.
    2. Data link: GetRecord > transactionDate - TryParse > value.
    3. Automation link: TryParse > Result > False - Jump To Error (Failed to parse invoice date).
    Compare method
    1. In the Toolbox, expand the Data Handling > Dates > Compare folder.
    2. Drag the Compare method to the automation surface.
      Data handling date compare method in the toolbox
    1. Automation link: TryParse > Result > True - Compare.
    2. Data link: TryParse > result - Compare > date1.
    3. Data link: discountDeadlineDate - Compare > date2.
    4. Automation link: Compare > Result > Before - Jump To Exit.
    5. Automation link: Compare > Result > Equal - Jump To Exit.
    6. Automation link: Compare > Result > After - Jump To Error (Invoice date is after deadline).
  3. On the automation surface, connect the links, as shown in the following figure:
    The CompareDate automation with execution and data links connected.
  4. On the toolbar, click Save to save the automation.

4 Update the invoice description

Create an automation that concatenates the invoice's number and bonus memo and saves it in a global variable to be used as a bonus transaction description.

  1. In the Project Explorer, click and open the ConcatenateInvoice automation.
  2. Add the following design blocks to the automation surface: 
    Design block name Action Connections
    Concat method
    1. In the Toolbox, in the search box, enter Concat, and then drag the Concat method onto the automation surface. 
      string concat method
    1. Automation link: Entry Point - Concat.
    bonusMemo Value property
    1. In the Toolbox, expand the Variables section and drag the String variable to the automation surface.
    2. On the design block, double-click String1 and then enter bonusMemo.
    3. On the design block, click Value, and then enter Robotic banking discount for invoice number:
    1. Data link: bonusMemo - Concat > list0.
    invoiceNumber Value property
    1. In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
    2. In the Select action window, select Value property and then click Add.
    1. Data link: invoiceNumber - Concat > list1.
    invoiceDescription Value property
    1. In the Palette, expand the Globals section and drag invoiceDescription global variable to the auotmation surface.
    2. In the Select action window, select Value property and then click Add.
    1. Automation link: Concat - invoiceDecription.
    2. Data link: Concat > Result - invoiceDescription.
    3. Automation link: invoiceDescription - Jump To Exit.
  3. On the automation surface, connect the links, as shown in the following figure:
    The ConcatenateInvoice automation with execution and data links.
  4. On the toolbar, click Save to save the automation.

5 Calculate discount

Create an automation that calculates a bonus of 20% of a customer's invoice amount for a user that signed up for the BankerInsight account.

  1. In the Project Explorer, click and open CalculateInvoiceDicount automation.
  2. Add the following design blocks to the automation surface: 
    Design block name Action Connections
    GetRecord method
    1. On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
    2. In the Select action dialog box, select the GetRecord method, and click Add.
    1. Automation link: Entry Point - GetRecord.
    2. Automation link: GetRecord > Result > False - Jump To Error (Failed to get record from lookup table)
    Value property
    1. In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
    2. In the Select action window, select Value property and then click Add.
    1. Data link: invoiceNumber - GetRecord > Key_invoiceNumber.
    Replace method
    1. In the Toolbox, in the search box, enter Replace, and then drag the Replace method of the string category onto the automation surface.
      string replace
    2. Hard code the oldValue parameter by clicking on it and typing a $ symbol.  Click on the newValue, hit the space bar, and then click on the automation surface which will hard code the newValue as a blank string.
      Screenshot showing the replace string design block with its parameters.
       
      Screenshot showing Replace method design block.
    1. Automation link: GetRecord > Result > False - Replace.
    2. Data link: GetRecord > transactionAmount - Replace > stringValue.
    dblAmount variable
    1. On the Toolbox, open the Variables folder, and then drag double variable onto the automation surface.
    2. On the design block, double-click Double1 and change the name of variable to dblAmount.
     
    TryParse method
    1. On the Palette tab, in the Locals section, drag the dblAmount variable onto the automation surface.
    2. In the Select action dialog box, click More, enter try in the search box, select the TryParse method, and then click Add.
    1. Automation link: Replace - TryParse.
    2. Data link: Replace > Result - TryParse > input.
    3. Automation link: TryParse > Result > False - Jump To Error (Failed to parse invoice data)
    NumericExpression component
    1. In the Toolbox, expand the Workflow > Expressions section.
    2. Drag the NumericExpression component onto the automation surface.
    3. Click inside the NumericExpression block, and then enter a*b.
    1. Automation link: TryParse > Result > True - NumericExpression.
    2. Data link: dblAmount > Value - NumericExpression > a.
    3. Data link: 20PercentDiscount - NumericExpression > b.
    4. Automation link: NumericExpression - Jump To Exit.
    calculatedAmount global variable
    1. On the Palette tab, in the Globals section, drag the calculatedAmount variable onto the automation surface.
    2. In the Select action dialog box, select the Value property, and then click Add.
    1. Data link: NumericExpression > result - calculatedAmount.
  3. On the automation surface, connect the links, as shown in the following figure:
    CalculateInvoiceDiscount automation with execution and data links connected.
  4. On the toolbar, click Save to save the automation.

Confirm your work

  1. In the Project Explorer, click and open BillPaySystemDiscount
  2. On the right-upper corner of Pega Robot Studio, click the Test button to run the automation test.
  3. In the Testing automation dialog box, enter 40932 and then click Test.
  4. Wait till automation completes, and a Test complete dialog box will be displayed. 
  5. On the Test complete dialog box, verify that automation ends with the Result equals True
    The Test complete dialog box with the automation result True.
  6. On the dialog box, click Done
  7. Display the BankerInsight application. 
  8. Click the Account Types tab.
  9. Verify that new transactions are added in the Transaction History section.
    The Account Types tab of Banker Insight appliation with transactions added by the automation.
  10. Close the BankerInsight application. 


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice